﻿#region

using System.Data.Entity.ModelConfiguration;
using HouseHoldBudget.Core.Entities.User;

#endregion

namespace HouseHoldBudget.Data.Mapping.Users
{
    public class BudgetUserMap : EntityTypeConfiguration<BudgetUser>
    {
        #region Constructors

        public BudgetUserMap()
        {
            ToTable("BudgetUser");
            HasKey(c => c.Id);

            Property(u => u.UserFirstName);
            Property(u => u.UserEmail);
            Property(u => u.UserPassword);
            Property(u => u.UserLastName);
            Property(u => u.UserLogin);
            Property(u => u.IsActive);

            HasMany(p => p.BudgetUserRoles)
                .WithMany()
                .Map(m => m.ToTable("BudgetUser_BudgetUserRole_Mapping"));
        }

        #endregion
    }
}